import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

export enum UserRole {
  ADMIN = 'ADMIN',
  AUTHOR = 'AUTHOR',
  GUEST = 'GUEST',
}

@Entity()
export class User {
  @PrimaryGeneratedColumn()
  id: number;
  @Column()
  firstName: string;
  @Column()
  public lastName: string;
  @Column({ unique: true })
  public email: string;
  @Column()
  public role: UserRole;
  @Column()
  public password: string;
  @Column()
  public createdAt: Date;
  @Column()
  public editedAt: Date;
  @Column({
    nullable: true,
  })
  public removedAt: Date;
}
